package shiqi.SimpleFactory.TV;

public class TVFactory {

    public static AbstractTV productTV(String name) throws Exception {
        if (name.equalsIgnoreCase("haier")) {
            System.out.println("工厂生产了海尔电视机");
            return new HaierTV();
        } else if (name.equalsIgnoreCase("Hisense")) {
            System.out.println("工厂生存了海信电视机");
            return new HisenseTV();
        } else {
            throw new Exception("对不起，这个牌子的不生产");
        }
    }
}
